Provides a consuming
IEnumerable<(Of <(T>)>) for items in the collection.
Calling MoveNext on the returned enumerable will block if there is no data available, or will
throw an
OperationCanceledException if the
CancellationToken is canceled.
Namespace:
System.Collections.Concurrent
Assembly:
System.Threading (in System.Threading.dll)
Syntax
Visual Basic (Declaration) |
---|
Public Function GetConsumingEnumerable ( _
cancellationToken As CancellationToken _
) As IEnumerable(Of T) |
C# |
---|
public IEnumerable<T> GetConsumingEnumerable(
CancellationToken cancellationToken
) |
Return Value
An
IEnumerable<(Of <(T>)>) that removes and returns items from the collection.
Exceptions
Exception | Condition |
---|
System..::.ObjectDisposedException | The BlockingCollection<(Of <(T>)>) has been disposed. |
System..::.OperationCanceledException | If the CancellationToken is canceled. |
See Also